package com.naja.event.tracking.extract.repository.mybatis;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.naja.event.tracking.extract.domain.TBaseEvent;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * 埋点基础事件(TBaseEvent)表数据库访问层
 *
 * @author EasyCode
 * @since 2023-09-18 10:02:18
 */
@DS("clickhouse_1")
public interface TBaseEventDao extends BaseMapper<TBaseEvent> {
    @Select("select * from naja_event_track.t_base_event final where traceId=#{traceId} and actionTime between #{actionBeginTime} and #{actionEndTime} order by actionTime desc ")
    List<TBaseEvent> selectFinalByTraceIdAndActionTimeRange(@Param("traceId") String traceId, @Param("actionBeginTime") Date actionBeginTime, @Param("actionEndTime") Date actionEndTime);
}

